home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DartmouthXCMDs.cpt / Dartmouth XCMDs Vol 1&2 / card_9241.txt < prev    next >
Text File  |  1989-02-26  |  5KB  |  184 lines

  1. -- card: 9241 from stack: in
  2. -- bmap block id: 8997
  3. -- flags: 0000
  4. -- background id: 8327
  5. -- name: XScrollBoxF
  6. ----- HyperTalk script -----
  7. on opencard
  8.   set the visible of field 1 to false -- background field
  9.   set the scroll of card field 1 to 0
  10.   set the scroll of card field 2 to 0
  11. end opencard
  12. on closecard
  13.   set the visible of field 1 to true
  14. end closecard
  15.  
  16.  
  17. -- part 2 (field)
  18. -- low flags: 00
  19. -- high flags: 4007
  20. -- rect: left=387 top=166 right=289 bottom=487
  21. -- title width / last selected line: 0
  22. -- icon id / first selected line: 0 / 0
  23. -- text alignment: 0
  24. -- font id: 3
  25. -- text size: 9
  26. -- style flags: 0
  27. -- line height: 12
  28. -- part name: scroller
  29.  
  30.  
  31. -- part 5 (field)
  32. -- low flags: 01
  33. -- high flags: 2007
  34. -- rect: left=18 top=32 right=290 bottom=384
  35. -- title width / last selected line: 0
  36. -- icon id / first selected line: 0 / 0
  37. -- text alignment: 0
  38. -- font id: 20
  39. -- text size: 12
  40. -- style flags: 0
  41. -- line height: 16
  42. -- part name: XCMD Text
  43.  
  44.  
  45. -- part 8 (field)
  46. -- low flags: 00
  47. -- high flags: 0002
  48. -- rect: left=387 top=55 right=147 bottom=487
  49. -- title width / last selected line: 0
  50. -- icon id / first selected line: 0 / 0
  51. -- text alignment: 0
  52. -- font id: 3
  53. -- text size: 9
  54. -- style flags: 0
  55. -- line height: 12
  56. -- part name: fonts
  57.  
  58.  
  59. -- part 9 (button)
  60. -- low flags: 00
  61. -- high flags: 8003
  62. -- rect: left=69 top=301 right=321 bottom=165
  63. -- title width / last selected line: 0
  64. -- icon id / first selected line: 0 / 0
  65. -- text alignment: 1
  66. -- font id: 0
  67. -- text size: 12
  68. -- style flags: 0
  69. -- line height: 16
  70. -- part name: XScrollBoxF
  71. ----- HyperTalk script -----
  72. on mouseUp
  73.   put empty into msg
  74.   put XScrollBoxf(0,"Choose Font for Stuff List:",card field "fonts", "Help") into f
  75.   if f is "Help" then
  76.     doHelp
  77.     exit mouseUp
  78.   else if f is empty then
  79.     put "You pressed the Cancel Button."
  80.     exit mouseUp
  81.   else
  82.     put item 2 of f into f
  83.     get XScrollBoxf("c","Choose some stuff:",card field "scroller","",f)
  84.     put "font was "&f&"...... Selection was: "&it
  85.   end if
  86. end mouseUp
  87.  
  88. on doHelp
  89.   put "Choose a font to use in displaying the test field."
  90. end doHelp
  91.  
  92.  
  93. -- part contents for card part 2
  94. ----- text -----
  95. able
  96. baker
  97. charlie
  98. dog
  99. ernest
  100. fox
  101. gamma
  102. horse
  103. ice cream
  104. jumping jack flash
  105. knockwurst
  106. liver
  107. monkey
  108. no way, jose
  109. occularity
  110. penelope
  111. qwerty
  112. rapscallion
  113. salubrious
  114. twinkle toes
  115. underwhelmed
  116. vermin
  117. wascally wabbit
  118. yokel
  119. zenzational
  120.  
  121. -- part contents for card part 5
  122. ----- text -----
  123. XScrollBoxF version 1.4
  124. Roger Brown
  125.  
  126. XScrollBoxF is a version of XScrollBox that allows the selection list to be presented in a font other than the system font.
  127. For example, this is being used to create an index to Greek literary references using a Greek font. All specifications are the same as for XScrollBox except for an additional input parameter: the name of the font to use. The named font must be available from the system or the stack and the font size will always be 12.
  128.  
  129. The return value has two items: the number of the selection and the text of the selection. These are separated by commas as in normal HyperCard format. 
  130.    
  131. Selection can be made by :
  132.    1. double-clicking on a line.
  133.    2. single-clicking on a line, then pressing the OK button.
  134.    3. single-clicking on a line, then pressing the Return key.
  135.    4. typing the first letter(s) of a selection, then doing 1,2, or 3.
  136.      (Note: type selection assumes that the lines are ordere alphabetically)
  137.    5. scrolling with up and down arrow keys, then doing 1,2 or 3.
  138.    
  139.    If the Cancel button is pressed, a null string is returned.
  140.    
  141.    It requires that the DITL and DLOG resources (1346) packaged with 
  142.    it are in the stack.
  143.    
  144.   The dialog is centered on the screen and sized to hold the width of the   
  145.    longest line and/or the prompt line, whichever is widest. It will not 
  146.    overrun the width of a  Mac+ screen.
  147.  
  148. INVOKING XScrollBoxF
  149.  
  150.   get XScrollBoxF(first,prompt,container,userButton,font)
  151.         
  152.    where   first  is a default selection in the list - either a number or a     
  153.                    text string (0 if none).
  154.                 prompt is a string to prompt the user. This appears at the top                      
  155.                    of the dialog box.
  156.                 container is any hypercard container (field, variable), 
  157.                    presumed to be multi-lined.
  158.                 UserButton  is the name for an optional author specified 
  159.                    button. If this button is pressed, its name is returned             
  160.                    further processing by the script.  
  161.                  Font is the name of the font to use.
  162.  
  163. EXAMPLE
  164.  
  165.  ex.  get XScrollBoxF(1,"Choose:",card field 1,"Help","cartoon")
  166.         if OK is pressed, returns : 1,text of line 1 of card field 1
  167.  
  168.  
  169. REVISION HISTORY
  170. 1.1 center dialog box on any size screen
  171. 1.2 - add selection scrolling by typing and by cursor keys
  172. 1.3 - add text of chosen item to return value
  173. 1.4 -- 3/2/88   add optional user button
  174.  
  175.  
  176. -- part contents for card part 8
  177. ----- text -----
  178. Chicago
  179. Courier
  180. Geneva
  181. Helvetica
  182. Monaco
  183. New York
  184. Doesn't Exist